package com.wzy.webfluxclient;

import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import webfluxclient.ApiServer;

@ApiServer("http://127.0.0.1:8080/user")
public interface IUserApi {
    @GetMapping("/")
    Flux<User> getAllUser();

    @GetMapping("/{id}")
    Mono<User> getUserById(@PathVariable("id") String id);

    @DeleteMapping("/{id}")
    Mono<Void> deleteUserById(@PathVariable("id") String id);

    @PostMapping("/")
    Mono<User> createUser(@RequestBody Mono<User> user);

    @PutMapping("/{id}")
    Mono<User> updateUserById(@PathVariable("id") String id, @RequestBody Mono<User> user);
}
